Some simple examples
Here are some simple things that I've already found useful.
Here's the macro I run to edit local sources. It starts the editor
asynchronously on the source file.
/* Edit the file currently displayed in Mosaic */
options results
'get url'
parse var result 'file://localhost/'name
if name ~= "" then address command 'emacs' name
That works in conjunction with:
Display html from the editor
This script works with mg to display the current buffer. You use the edit macro to start the editor, then this one to
display changes.
/* Display the current file in Amiga Mosaic */
'save-buffer'
'rexx-window' window
address AMOSAIC.1 'jump url file://localhost/data:html/Mosaic-Rexx-Interface/'window.4
exit 0
Edit & reload
This digs the editor out of the UUCP environment, then invokes that on
the source. If the source is local, you edit that file. If the source
is not local, you edit a local copy. After you're through, the new
version is displayed in Mosaic.
/* Edit the HTML source to a document. */
options results
'get url'
parse var result 'file://localhost/'name
if name = "" then do
/* Get a name for the scratch file */
do i = 0 until ~Exists(name)
name = "t:wwwtmp"i
end
if ~open(out, name, 'Write') then exit 20
'fetch source'
call writech out, result
call close out
end
address command getuuenv('editor') name
'jump url file://localhost/'name
exit 0
Some scripts I hope to write
- A script that looks for expires information in a page, and schedules a
reload at the expire time.
- A pair of scripts that do bookmarks. One saves the offest into
the current document, and the other looks up the bookmark for the
current document and goes there.
- A wedge script (that needs the unwritten wedge
command) that the Nonet version of Amiga Mosaic uses to drive a
terminal emulator to fetch documents from over the net.
- A udpate script that checks all the links in a specific
document to see if any have changed since the last time it was
checked. This would allow automatic monitering of remote pages for changes.
If you can think of more examples, feel free to send mail to
mwm@contessa.phone.net
.
Up to the manual or back to objects.
Mike W. Meyer